package com.lagou.user.impl;


import com.alibaba.dubbo.config.annotation.Service;
import com.lagou.entity.User;
import com.lagou.user.UserService;
import mapper.UserDao;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * 用户表(User)表服务实现类
 *
 * @author makejava
 * @since 2021-11-25 23:38:25
 */
@Service //暴露服务。让消费者能够找到我
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public User login(String phone, String password) {

        User login = userDao.login (phone, password);
        return login;
    }

    @Override
    public Integer checkPhone(String phone) {
        Integer i = userDao.checkPhone (phone);
        return i;
    }

    @Override
    public Integer register(String phone, String password) {

        Integer i = userDao.register (phone, password);

        return i;
    }

    @Override
    public Integer updateUserInfo(Integer id,String portrait, String name) {

        return userDao.updateUserInfo (id,portrait,name);
    }

    @Override
    public Integer updatePassword(Integer id,String password) {
        return userDao.updatePassword (id,password);
    }
}
